

function LongButton(screen, x, y, text, onClick) {
    // These are the images of the large button in their different states.
    src = "resources\\preferences\\buttons\\longButton.png";
    src_mousedown = "resources\\preferences\\buttons\\longButtonApertado.png";
    
    this.button = screen.appendElement("<div enabled=\"true\" x=\""+x+"\" y=\""+y+"\" width=\"122\" height=\"22\" ></div>");
    this.label = this.button.appendElement("<label x=\"0\" y=\"0\" vAlign=\"middle\" align=\"center\" width=\"100%\" height=\"100%\" color=\"#FFFFFF\" font=\"Verdana\" size=\"8\">"+text+"</label> ")
    
    this.button.background = src;
    var self = this;
    if (onClick) {
        this.onClick = onClick;
        
        this.button.onmousedown = function() {
            self.button.background = src_mousedown;
        };
        this.button.onmouseup = function() {
            self.button.background = src;
        };
        this.button.onmouseover = function() {
            
        };
        this.button.onmouseout = function () {
            self.label.bold = false;
        };
        this.button.onclick = function() {
            self.onClick();
        };
    }
}

function ColorButton(screen, x, y, color, text) {
    var self = this;
    
    
    
    //this.layout = layout;
    this.button = screen.appendElement("<div enabled=\"true\" x=\""+x+"\" y=\""+y+"\" width=\"26\" height=\"22\" ></div>");
    this.button.tooltip = TOOLTIP_CHANGECOLOR;
    if (text) {
        this.label = screen.appendElement("<label x=\""+(x+26+2)+"\" y=\""+y+"\" width=\"60\" height=\"22\" vAlign=\"middle\" align=\"left\" color=\"#FFFFFF\" >"+text+"</label>");
    }
    this.color = color;
    if (this.label) {
        this.button.onmouseout = function() {
            self.label.bold = false;
        };
        this.button.onmouseover = function() {
            self.label.bold = true;
        };
    }
    this.button.onclick = function() {
        showChooseLayout( self.color );
    };
    
    this.update();
}

ColorButton.prototype.update = function() {
    this.button.background = "resources\\preferences\\buttons\\" + options.getValue(this.color) + ".png";
}